package emby;

import java.io.FileNotFoundException;

import emby.util.IO;

/**
 * Runner allows the usage of emby through the command line.
 * If you wish to run emby through java, use the Script class instead.
 * <br>
 * Usage as follows:
 * 	java emby.Runner <emby file name>
 * @author Justin
 */
public class Runner {

	public static void main(String[] args) throws FileNotFoundException{
		/*
		System.out.println("Emby build 6.13.2012");
		System.out.print("Running on "+System.getProperty("os.name")+" (v"+System.getProperty("os.version")+")");
		System.out.println(" @ "+System.getProperty("os.arch"));
		System.out.println("Java "+System.getProperty("java.version")+" by "+System.getProperty("java.vendor"));
		*/
		String directory = IO.getDirectory(args[0]);
		EnvironmentPaths.setWorkingDirectory(directory);
		Script<Object> s = new Script<Object>(args[0]);
		//compile
		s.eval();
		jstlib.parallel.TaskManager.getInstance().shutdown();
	}
}
